#include <localtime.h>

#define LOGGERFILE "/log/logger.log"

string current_time()
{
	mixed tims = localtime(time());
	return sprintf("%d-%d-%d %d:%d:%d", tims[LT_YEAR], tims[LT_MON], tims[LT_MDAY], tims[LT_HOUR], tims[LT_MIN], tims[LT_SEC]);
}

void LogDebug(string message)
{
	efun::write_file(LOGGERFILE, sprintf("%s %s\n", current_time(), message));
}

void LogWarning(string message)
{
	efun::write_file(LOGGERFILE, sprintf("%s %s\n", current_time(), message));
}

void LogError(string message)
{
	efun::write_file(LOGGERFILE, sprintf("%s %s\n", current_time(), message));
}

void LogText(string message)
{
	efun::write_file(LOGGERFILE, message);
}